﻿Imports RunEnv
Imports User
Public Class CPrimeManager
    Private mobjPrimeEditor As New CPrimeEditor

    Public ReadOnly Property PrimeEditor() As CPrimeEditor
        Get
            Return mobjPrimeEditor
        End Get
    End Property

    Public Property cnn As CDBConnection
        Get
            Return gcnnDBMain
        End Get
        Set(value As CDBConnection)
            gcnnDBMain = value
        End Set
    End Property

    Public Sub InitCard(ByVal managerTitle As String, ByVal objRight As CRight)
        Dim objTableInfo As CTableInfo
        objTableInfo = New CTableInfo(managerTitle)
        mobjPrimeEditor.TableInfo = objTableInfo
        mobjPrimeEditor.Right = objRight

        mobjPrimeEditor.RaiseInitialize()
    End Sub

    Public Function ShowCard(ByVal isAddNewMode As Boolean,
                             ByVal isEditState As Boolean,
                               Optional IDValues() As Object = Nothing,
                               Optional pageMove As IPageMove = Nothing) As Boolean
        Dim objDlgItem As New dlgItem
        objDlgItem.Init(mobjPrimeEditor, pageMove)
        Return objDlgItem.ShowOpen(isAddNewMode, isEditState, IDValues)
    End Function
End Class
